var http = require('http');
http.createServer(function (req, res) {
	console.log(req.url)
	http.get('http:/'+req.url,
	function(req){
	var chunks = [];
  //获取长度
  let num = 0;
  req.on("data", function (chunk) {
    chunks.push(chunk);
    num += chunk.length;
  });
	req.on('end',function(){
		var buffer = Buffer.concat(chunks, num);
		res.writeHead(200, {'Content-Type': 'video/mp4',
			'Access-Control-Allow-Origin':'*'
		});
		res.end(buffer);
	});
})
}).listen(82);
			// 'Content-Length':num,
			// 'Content-Range':'bytes 0-'+(num-1)+'/'+num
console.log('Server running at http://127.0.0.1:82/');